/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-01-12 09:35:49
 * @LastEditTime : 2023-06-01 11:04:02
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Modal\ThrModalList\Organization.jsx
 * @Description  :
 */
/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-10-13 08:39:23
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2022-10-13 09:08:05
 * @FilePath: \adminstration\src\Common\Modal\ThrModalList\Organization.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { API_LIST } from '../../Api/Api'
import { commonTableList } from '../config'

export const Organization = async ({ data }) => {
    let dataList = {
        uuid: data.uuid,
        type: '添加从属机构',
        width: 800,
        classification: 'SelectModal',
        hideInSearch: true,
        pageSize: 10,
        params: {},
        isCheckbox: true,
        get: API_LIST()['getOrganizationRelationGetNotOrgListByParentOrgUuid'],
        pos: 'posOrganizationRelation',
        additional: { key: 'ParentOrganizationUuid', value: 'uuid' },
        assemblyData: e => {
            return e.map(key => ({
                parentOrganizationUuid: data.uuid,
                organizationUuid: key.uuid,
            }))
        },
        columns: [{ ...commonTableList.tableName, title: '组织机构' }],
    }

    return dataList
}
